// 丑数2
package Leetcode_Second_Brush;

import java.util.Arrays;

public class Solution274 {
    public int hIndex(int[] citations) {
        Arrays.sort(citations);
        int length = citations.length;
        for (int i = length - 1; i >= 0; i--)
            if (citations[i] < length - i)
                return length - i - 1;

        return length;
    }


}
